﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace SimpleBlog.Models
{
    public class Post
    {
        public Post()
        {
            Tags = new List<Tag>();
            Comments = new List<Comment>();
        }

        public int PostId { get; set; }

        [Required]
        public string Title { get; set; }

        [Required]
        public string EncodedTitle { get; set; }

        [Required]
        public string Text { get; set; }

        [Required]
        public string Summary { get; set; }

        [Required]
        public DateTime Created { get; set; }

        [Required]
        public User Creator { get; set; }

        public ICollection<Tag> Tags { get; set; }

        public ICollection<Comment> Comments { get; set; }
    }
}